#include <iostream>
#include <ctime>
#include "SparseGraph.h"
#include "DenseGraph.h"
using namespace std;
int main() {

    int N=20;
    int M=100;

    srand(time(NULL));

    SparseGraph g1(N, false);
    while(g1.E()<M){
        int a = rand() % N;
        int b = rand() % N;

        g1.addEdge(a, b);
    }
    cout<<"E1 : "<<g1.E()<<endl;
    for (int v = 0; v < N; v++) {
        cout<<v<<" : ";
        SparseGraph::adjIterator adj(v, g1);
        for (int w =adj.begin();!adj.end();w=adj.next())
            cout<<w<<" ";
        cout<<endl;

    }
    cout<<endl;

    DenseGraph g2(N, false);
    while(g2.E()<M){
        int a = rand() % N;
        int b = rand() % N;

        g2.addEdge(a, b);
    }
    cout<<"E2 : "<<g2.E()<<endl;
    for (int v = 0; v < N; v++) {
        cout<<v<<" : ";
        DenseGraph::adjIterator adj(v,g2);
        for (int w = adj.begin();!adj.end(); w=adj.next())
//            if (w!=-1)
            cout<<w<<" ";
        cout<<endl;
    }
    return 0;
}